Skip to content

Fix main build: remove dangling Tool.Execution reference in BuildLegacyWireProtocolTool#1660

Merged
halter73 merged 1 commit into
mainfrom
halter73/fix-main-build-tool-execution
Jun 17, 2026
Merged

Fix main build: remove dangling Tool.Execution reference in BuildLegacyWireProtocolTool#1660
halter73 merged 1 commit into
mainfrom
halter73/fix-main-build-tool-execution

Conversation

@halter73

Copy link
Copy Markdown
Contributor

The break

main currently does not compile, and its own Build and Test CI run is red. This blocks PR #1484 and every other PR, because they inherit the broken main when they merge it.

The error comes from src/ModelContextProtocol.Core/Server/AIFunctionMcpServerTool.cs, inside BuildLegacyWireProtocolTool():

AIFunctionMcpServerTool.cs(265,13): error CS0117: 'Tool' does not contain a definition for 'Execution'
AIFunctionMcpServerTool.cs(265,38): error CS1061: 'Tool' does not contain a definition for 'Execution'

across all target frameworks (net10.0/net9.0/net8.0/netstandard2.0). Because TreatWarningsAsErrors=true, the build fails outright.

Root cause — a semantic (logical) merge conflict

When #1568 merged on top of #1579, the result was a semantic merge conflict: a dangling Execution = ProtocolTool.Execution, line referencing a property that no longer exists. No textual git conflict was raised, so it merged red.

The fix

Remove the single dangling line from the object initializer in BuildLegacyWireProtocolTool():

             Annotations = ProtocolTool.Annotations,
-            Execution = ProtocolTool.Execution,
             Icons = ProtocolTool.Icons,
             Meta = ProtocolTool.Meta,

Tool.Execution is not re-added — its removal was the intentional SEP-2663 design, and re-adding it would resurrect a deliberately-removed API and break the compatibility baseline. A full src/ grep confirms no other compiled references to a .Execution member on Tool or to the removed ToolExecution type remain (the only remaining hits are the CompatibilitySuppressions.xml baseline entries and unrelated names like ExecutionContext / TryGetOuterToolExecutionActivity).

Verification

  • dotnet build -c Debugsucceeds for all target frameworks, 0 warnings / 0 errors.
  • SEP-2106 legacy-wire back-compat tests (Sep2106ListToolsBackCompatTests, which exercise BuildLegacyWireProtocolTool) — 21/21 pass.
  • Full tests/ModelContextProtocol.Tests (net10.0) — all 2070 non-environment tests pass. The only failures are pre-existing, environment-dependent tests unrelated to this change (stdio tests that spawn TestServer.exe, which isn't on PATH here, and a Docker-dependent test).

This unblocks PR #1484 and all other PRs by getting main green again.

…cyWireProtocolTool

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@halter73 halter73 merged commit de75c7d into main Jun 17, 2026
9 of 10 checks passed
@halter73 halter73 deleted the halter73/fix-main-build-tool-execution branch June 17, 2026 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants